home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
TEMP
/
GNU
/
bison
/
BisonOptio
< prev
next >
Wrap
Text File
|
1995-06-28
|
5KB
|
153 lines
Bison Options
Previous: <Invocation=>Invocation> * Next: <Option Cross Key=>OptionCros> * Up: <Invocation=>Invocation>
#Wrap on
{fH3}Bison Options{f}
Bison supports both traditional single-letter options and mnemonic long
option names. Long option names are indicated with {fEmphasis}--{f} instead of
{fEmphasis}-{f}. Abbreviations for option names are allowed as long as they
are unique. When a long option takes an argument, like
{fEmphasis}--file-prefix{f}, connect the option name and the argument with
{fEmphasis}={f}.
Here is a list of options that can be used with Bison, alphabetized by
short option. It is followed by a cross key alphabetized by long
option.
#Indent +4
#Indent
{fEmphasis}-b {fStrong}file-prefix{f}{f}
#Indent +4
#Indent
{fEmphasis}--file-prefix={fStrong}prefix{f}{f}
#Indent +4
Specify a prefix to use for all Bison output file names. The names are
chosen as if the input file were named {fCite}{fStrong}prefix{f}.c{f}.
#Indent
{fEmphasis}-d{f}
#Indent +4
#Indent
{fEmphasis}--defines{f}
#Indent +4
Write an extra output file containing macro definitions for the token
type names defined in the grammar and the semantic value type
{fCode}YYSTYPE{f}, as well as a few {fCode}extern{f} variable declarations.
If the parser output file is named {fCite}{fStrong}name{f}.c{f} then this file
is named {fCite}{fStrong}name{f}.h{f}.
This output file is essential if you wish to put the definition of
{fCode}yylex{f} in a separate source file, because {fCode}yylex{f} needs to
be able to refer to token type codes and the variable
{fCode}yylval{f}. \*Note <Token Values=>TokenValue>: Semantic Values of Tokens.
#Indent
{fEmphasis}-l{f}
#Indent +4
#Indent
{fEmphasis}--no-lines{f}
#Indent +4
Don't put any {fCode}\#line{f} preprocessor commands in the parser file.
Ordinarily Bison puts them in the parser file so that the C compiler
and debuggers will associate errors with your source file, the
grammar file. This option causes them to associate errors with the
parser file, treating it an independent source file in its own right.
#Indent
{fEmphasis}-o {fStrong}outfile{f}{f}
#Indent +4
#Indent
{fEmphasis}--output-file={fStrong}outfile{f}{f}
#Indent +4
Specify the name {fStrong}outfile{f} for the parser file.
The other output files' names are constructed from {fStrong}outfile{f}
as described under the {fEmphasis}-v{f} and {fEmphasis}-d{f} switches.
#Indent
{fEmphasis}-p {fStrong}prefix{f}{f}
#Indent +4
#Indent
{fEmphasis}--name-prefix={fStrong}prefix{f}{f}
#Indent +4
Rename the external symbols used in the parser so that they start with
{fStrong}prefix{f} instead of {fEmphasis}yy{f}. The precise list of symbols renamed
is {fCode}yyparse{f}, {fCode}yylex{f}, {fCode}yyerror{f}, {fCode}yynerrs{f},
{fCode}yylval{f}, {fCode}yychar{f} and {fCode}yydebug{f}.
For example, if you use {fEmphasis}-p c{f}, the names become {fCode}cparse{f},
{fCode}clex{f}, and so on.
\*Note <Multiple Parsers=>MultiplePa>: Multiple Parsers in the Same Program.
#Indent
{fEmphasis}-t{f}
#Indent +4
#Indent
{fEmphasis}--debug{f}
#Indent +4
Output a definition of the macro {fCode}YYDEBUG{f} into the parser file,
so that the debugging facilities are compiled. \*Note <Debugging=>Debugging>: Debugging Your Parser.
#Indent
{fEmphasis}-v{f}
#Indent +4
#Indent
{fEmphasis}--verbose{f}
#Indent +4
Write an extra output file containing verbose descriptions of the
parser states and what is done for each type of look-ahead token in
that state.
This file also describes all the conflicts, both those resolved by
operator precedence and the unresolved ones.
The file's name is made by removing {fEmphasis}.tab.c{f} or {fEmphasis}.c{f} from
the parser output file name, and adding {fEmphasis}.output{f} instead.
Therefore, if the input file is {fCite}foo.y{f}, then the parser file is
called {fCite}foo.tab.c{f} by default. As a consequence, the verbose
output file is called {fCite}foo.output{f}.
#Indent
{fEmphasis}-V{f}
#Indent +4
#Indent
{fEmphasis}--version{f}
#Indent +4
Print the version number of Bison and exit.
#Indent
{fEmphasis}-h{f}
#Indent +4
#Indent
{fEmphasis}--help{f}
#Indent +4
Print a summary of the command-line options to Bison and exit.
#Indent
{fEmphasis}-y{f}
#Indent +4
#Indent
{fEmphasis}--yacc{f}
#Indent +4
#Indent
{fEmphasis}--fixed-output-files{f}
#Indent +4
Equivalent to {fEmphasis}-o y.tab.c{f}; the parser output file is called
{fCite}y.tab.c{f}, and the other outputs are called {fCite}y.output{f} and
{fCite}y.tab.h{f}. The purpose of this switch is to imitate Yacc's output
file name conventions. Thus, the following shell script can substitute
for Yacc:
#Wrap off
#fCode
bison -y $\*
#f
#Wrap on
#Indent